package com.yyn.pigeon.controller;


import com.yyn.pigeon.config.R;
import com.yyn.pigeon.entity.Category;
import com.yyn.pigeon.service.CategoryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 菜品及套餐分类 前端控制器
 * </p>
 *
 * @author yyn
 * @since 2023-03-15
 */
@RestController
@RequestMapping("/pigeon/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;
@ApiOperation("所有分类")
    public R getAll(){
    List<Category> all = categoryService.getAll();
    return R.success().data("all",all);
}
}

